home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Typography Samples / Circular Layout ƒ / QDGX shell.h < prev   
Encoding:
C/C++ Source or Header  |  1995-04-10  |  3.6 KB  |  129 lines  |  [TEXT/KAHL]

  1. /****************************************************************************/
  2. /*                                                                            */
  3. /*    interfaces for a simple, MULTI-window graphics shell                    */
  4. /*                                                                            */
  5. /*    ©1990 - 1994  Apple Computer, Inc.                                        */
  6. /*    All rights reserved.                                                    */
  7. /*                                                                            */
  8. /****************************************************************************/
  9.  
  10. #include <Desk.h>
  11. #include <Events.h>
  12. #include <Fonts.h>
  13. #include <Windows.h>
  14. #include <Memory.h>
  15. #include <ToolUtils.h>
  16. #include <Menus.h>
  17. #include <Resources.h>
  18. #include <Quickdraw.h>
  19. #include <GestaltEqu.h>
  20. #include <CodeFragments.h>
  21.  
  22. #include "graphics toolbox.h"
  23. #include "graphics routines.h"
  24. #include "graphics libraries.h"
  25. #include "graphics debugging.h"
  26. #include "graphics macintosh.h"
  27. #include "font library.h"
  28. #include "qd library.h"
  29. #include "PrintingMessages.h"
  30. #include "PrintingManager.h"
  31.  
  32.  
  33.  
  34.  
  35. /**\
  36. |**| ---------------------------------------------------------------------
  37. |**| EXTERN GLOBALS
  38. |**| ---------------------------------------------------------------------
  39. \**/
  40. // the following are expected to be initialized by the shell:
  41.  
  42. // QuickDraw GX shell.c:
  43.  
  44. extern Boolean        gQuitting;
  45.  
  46. // the following are expected to be initialized by your code:
  47.  
  48. extern Rect         gWindowQDRect;
  49. extern Str255        gWindowTitle;
  50. extern Boolean        gDebugging;
  51. extern Boolean        gGiveMeValidation;
  52. extern long            gGraphicsHeapSize;
  53.  
  54.  
  55.  
  56. /**\
  57. |**| ---------------------------------------------------------------------
  58. |**| PROTOTYPES
  59. |**| ---------------------------------------------------------------------
  60. \**/
  61.  
  62. // QuickDraw GX shell.c:
  63.  
  64. void    main                    (void);
  65. void     InitToolbox                (void);
  66. void    CheckQuickDrawGX        (void);
  67. OSErr    MyPrintingEventOverride    (EventRecord *event, Boolean filterEvent);
  68. void    EventLoop                (void);
  69. Boolean    IsAppWindow                (WindowPtr wind);
  70. void    MyDoEvent                (EventRecord *event);
  71. void    DoMouseDown                (EventRecord *event);
  72.  
  73. // QDGX shell misc.c:
  74.  
  75. void    DoMenuCommand            (long menuResult);
  76. gxJob    GetDocJob                (WindowPtr);
  77. gxShape    GetDocShape                (WindowPtr);
  78. gxShape    GetDocOvalShape            (WindowPtr);
  79. gxShape    GetDocEraseShape        (WindowPtr);
  80. short    MyStrLength                (char *s);
  81.  
  82. // QDGX shell printing.c:
  83.  
  84. void    SetUpEditMenuRec        (gxEditMenuRecord *);
  85. OSErr    DoFormat                (WindowPtr, gxDialogResult    *);
  86. OSErr    DoPrinting                (WindowPtr);
  87. OSErr    DoPrintOne                (WindowPtr);
  88.  
  89. // routines required by your code
  90. void    DoSetup                    (void);
  91. void    DoDraw                    (WindowPtr wind, Boolean updating);
  92. OSErr    DoCreateNew                (void);
  93. void    DoDispose                (WindowPtr wind);
  94. void    DoIdle                    (WindowPtr wind);
  95. void    DoTeardown                (void);
  96. void    DoClick                    (WindowPtr wind, Point p);
  97.  
  98.  
  99.  
  100. /**\
  101. |**| ---------------------------------------------------------------------
  102. |**| ENUMS
  103. |**| ---------------------------------------------------------------------
  104. \**/
  105. enum dlogIDs {rAboutBoxID=128,rNoQuickDrawGXID=129};
  106.  
  107. enum mbarID {rMenuBar=128};
  108.  
  109. enum menus {mApple=128,mFile,mEdit};
  110.  
  111. enum mApplItems {iAbout=1};
  112. enum mFileItems {iNew=1,iOpen,iClose,iSave,iPageSetup=6,iPrint,iPrintOne,iQuit=10};
  113. enum mEditItems {iUndo=1,iCut=3,iCopy,iPaste,iClear};
  114.  
  115.  
  116. /**\
  117. |**| ---------------------------------------------------------------------
  118. |**| STRUCTS
  119. |**| ---------------------------------------------------------------------
  120. \**/
  121. // This is the structure we use to hold our private data for each window.
  122. // We store a handle to one of these beasties in each window's refCon field.
  123.  
  124. typedef struct {
  125.               gxJob        docJob;            // print job for this document.
  126.               gxShape    docOval;        // the oval for this window's document.
  127.               gxShape    eraseOval;        // the oval to erase the previous drawing oval.
  128. } T_Doc, *TP_Doc, **TH_Doc;
  129.